import matplotlib.pyplot as plt

file = open('6.txt')#打开文档6.txt
data = file.readlines()
score=[]
for num in data:
    score.append(float(num.split(',')[0]))                  
bins=[0,10,20,30,40,50,60,70,80,90]
plt.hist(score,bins,rwidth = 0.8,label='population')
plt.title('Score')
plt.xlabel('Interval')
plt.ylabel('Population')
plt.legend()
plt.show()
                 
                       
